class ChartData {
  constructor(chartType, yColumn, xColumn) {
    this.chartType = chartType ? chartType : '';
    this.yColumn = yColumn ? yColumn : [];
    this.xColumn = xColumn ? xColumn : [];
  }

  GetChartData(selectData) {
    var xTitle = [];
    var xValue = [];
    selectData.forEach(item => {
        xTitle.push(item.fieldZhName);
        xValue.push(item.id);
    });
    return {
      title: {
        text: 'BAR',
      },
      tooltip: {},
      xAxis: {
        data: xTitle,
      },
      yAxis: {},
      series: [
        {
          data: xValue,
          type: 'bar',                   
        },
      ],
    };
  }
}
export default new ChartData();
